<template>
  <u-form-grid :data="formGrid"></u-form-grid>
</template>

<script>
export default {
  name: 'Resources',
  data () {
    return {
      formGrid: {
        options: {
          version: 'v2',
          url: {
            page: "/role/resources/page",
            save: "/role/resources/save",//记录添加和修改提交的地址，如果提交的对象有id则为修改
            delete: "/role/resources/delete",//记录删除的提交地址，通过提交id的集合来实现一个或者多个记录
            get: "/role/resources/find",//查看和编辑时用于查询对象的接口，参数为定义的keys
          }
        },
        tips: {"title": "资源管理", "content": "FormGrid是一个结合表单查询、修改、删除等全功能的组件。方便快速实现CRUD功能!"},

        form: {
          modal: {
            title: "个人信息"
          },
          columns: [
            {label: "资源名称", type: "text", name: "name", required: true},
            {label: "资源类型", type: "text", name: "resourceType", required: false},
            {label: "资源路径", type: "text", name: "url", required: true},
            {label: "界面渲染描述JSON", type: "text", name: "themeJson", required: true},
            {label: "权限描述", type: "text", name: "permission", required: true},
            {label: "父资源ID", type: "text", name: "parentId", required: true},
            {label: "是否启用", type: "text", name: "available", required: true},
          ]
        },
        table: {
          operation: {
            //调用查看、编辑、删除接口时，需要传递的参数主键名称，可以有多个。默认为id
            primaryKey: "id",
          },
          columns: [
            { title: '资源ID', key: 'id' },
            { title: '资源名称', key: 'name' },
            { title: '资源类型', key: 'resourceType' },
            { title: '资源路径', key: 'url' },
            { title: '父资源ID', key: 'parentId' },
            { title: '是否启用', key: 'available' },
            { title: '权限描述', key: 'permission' },
          ]
        }
      }
    }
  },
  methods: {

  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>

</style>
